import express from "express";
import { Request } from "express";
import { login } from "../../services/user";
import { CustomResponse } from "../../middleware/error";
import { validate } from "../../middleware/validator";
import { res_login_schema } from "@/schema/user/userInfo";

const UserRouter = express.Router();

/**
 * 只有登录接口
 */
UserRouter.post("/login", validate(res_login_schema), async (req: Request, res: CustomResponse) => {
  await login(req, res);
});

export default UserRouter;
